package com.reading_recognition_system.service.impl;

import com.reading_recognition_system.mapper.UserMapper;
import com.reading_recognition_system.pojo.User;
import com.reading_recognition_system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User findUser(String usercode, String password) {
        return userMapper.findUser(usercode, password);
    }

    @Override
    public User findOne(int u_id) {
        return userMapper.findOne(u_id);
    }


        @Override
    public Integer updateUser(User user) {
        Integer flag=0;
        flag=userMapper.updateUser(user);
        return flag;
    }

    @Override
    public Integer insertUser(String usercode, String password) {
        Integer flag=0;
        flag=userMapper.insertUser(usercode,password);
        return flag;
    }

    @Override
    public Integer deleteUser(int u_id) {
        Integer flag=0;
        flag=userMapper.deleteUser(u_id);
        return flag;
    }

}
